package com.wss.day02.test01;

/**
 * @author wangshaoshuai
 * @desc TODO
 * @date 2025/4/21
 */
public class Father extends GrandFather {
    private String occupation;
    public Father(String name, int age, String occupation) {
        super(name, age);
        this.occupation = occupation;
    }

    public Father() {
    }

    public Father(String occupation) {
        this.occupation = occupation;
    }

    /**
     * 获取
     * @return occupation
     */
    public String getOccupation() {
        return occupation;
    }

    /**
     * 设置
     * @param occupation
     */
    public void setOccupation(String occupation) {
        this.occupation = occupation;
    }

    public String toString() {
        return "Father{occupation = " + occupation + "}";
    }
    public void show(){
        System.out.println("爷爷叫 " + name + ", 年龄为 " + age+"职业是"+occupation);
    }
}
